<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 
<meta http-equiv="Pragma" content="no-cache"> 
<meta http-equiv="Cache-Control" content="no-cache"> 
<meta http-equiv="Expires" content="0"> 
<title>后台登录</title> 
<link href="css/rootlogin.css" type="text/css" rel="stylesheet"> 
<script type="text/javascript" src="js/jquery-3.1.0.min.js" language="javascript"></script>
<script type="text/javascript" src="js/layer/layer.js"></script><!--表单验证JS-->
<script type="text/javascript"  language="javascript">
		$(function(){
			$("#login").click(function(){
				var username=$("#username").val();
				var password=$("#password").val();
				if(username==""||password==""){
					layer.msg('未输入账号或密码', {time: 2000,icon: 2});
				}else{
				$.ajax({
					url:"../rootlogin.do",
					type:"post",
					dataType:"json",
        			data:"username="+username+"&password="+password,
        			success:function(data){
        				if(data=="true"){
        					window.location.href="rootmain/rootmain.html";
        				}else{
        					layer.msg('登录失败！您不是管理员，或账号密码输入错误', {time: 2000,icon: 2});
        					$("#password").val("");
        				}
        			}
				});}
			});
			$("#log").click(function(){
				window.location.href="index.html";
			});
		});
	</script>  
</head> 
<body> 

<div class="login">
    <div class="message">管理员登录</div>
    <div id="darkbannerwrap"></div>
    
    <form method="post">
		<input name="action" value="login" type="hidden">
		<input name="username" id="username" placeholder="用户名" required="" type="text">
		<hr class="hr15">
		<input name="password" id="password" placeholder="密码" required="" type="password">
		<hr class="hr15">
		<input value="登录" id="login" style="width:100%;" type="button">
		<hr class="hr20">
	</form>

	
</div>

<
</body>
</html>